<template>
    <div>
        <a-card size="small" :title="$route.meta.title">
            <template #extra><a href="#">more</a></template>
            <a-tabs v-model:activeKey="activeKey">
                <a-tab-pane :tab="item.title" v-for="item in systemConfigList?.lists || []" :key="item.id">
                    <field :config="item.config" @success="run" />
                </a-tab-pane>
                <a-tab-pane key="2" tab="Tab 2" force-render>Content of Tab Pane 2</a-tab-pane>
                <a-tab-pane key="setConfig" tab="新增配置">
                    <addtags :systemConfigList="systemConfigList || []" @success="run" />

                </a-tab-pane>
            </a-tabs>
        </a-card>
    </div>
</template>
<script setup lang="ts">

import { getSystemConfig } from '@/api/system/system'
import { useRequest } from 'vue-request'
import addtags from './components/addtags.vue'
import field from './components/field.vue'

const { data: systemConfigList, run } = useRequest(getSystemConfig, {
    onSuccess: (res) => {
        console.log(res)
    }
})
const activeKey = ref(1)

onMounted(() => {
    run()
})


</script>
